import org.junit.Test;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Demo {
    @Test
    public void test() {
        String str = "1209963385＠@qq.com";
        String regex = "^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$";
        System.out.println(match(regex, str));
    }

    private static boolean match(String regex, String str) {
        Pattern pattern = Pattern.compile(regex);
        Matcher matcher = pattern.matcher(str);
        return matcher.matches();
    }
}
